package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String,Integer>map = new HashMap<>();
        map.put("语文",90);
        map.put("数学",96);
        map.put("英语",99);
        map.put("物理",97);
        map.put("化学",92);
        System.out.println(map);

        Integer value = map.put("语文",60);
        System.out.println(value);
        System.out.println(map);

        value = map.put("政治",89);
        System.out.println(value);//若不是替换操作则返回值为null
        System.out.println(map);

        value = map.put("体育",100);
        System.out.println(value);
        System.out.println(map);
    }
}
